package assignment6;

import static org.junit.Assert.assertTrue;

import java.io.File;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class MorseCodeConverterTest {
	
	public MorseCodeConverter mcc = new MorseCodeConverter();
	
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {}
	
	@AfterClass
	public static void tearDownAfterClass() throws Exception {}
	
	@Before
	public void setUp() throws Exception {}
	
	@After
	public void tearDown() throws Exception {}
	
	@Test
	public final void testConvertToEnglishFile() {
		
		String file1 = "C:\\Users\\twasser\\Documents\\School\\2011\\09 Fall\\CS204-21370\\workspace\\assignment6\\src\\ruffles.txt";
		String testF1 = "ruffles have ridges";
		File testFile1 = new File(file1);
		String convertF1 = mcc.convertToEnglish(testFile1).trim();
		assertTrue(convertF1.equalsIgnoreCase(testF1));
		
		String file2 = "C:\\Users\\twasser\\Documents\\School\\2011\\09 Fall\\CS204-21370\\workspace\\assignment6\\src\\atomic.txt";
		String testF2 = "now, i am become death, the destroyer of worlds. - j. robert oppenheimer";
		File testFile2 = new File(file2);
		String convertF2 = mcc.convertToEnglish(testFile2).trim();
		assertTrue(convertF2.equalsIgnoreCase(testF2));
	}
	
	@Test
	public final void testConvertToEnglishString() {
		
		String test1 = "to boldy go where no man has gone before";
		String convert1 = mcc
				.convertToEnglish("- --- / -... --- .-.. -.. .-.. -.-- / --. --- / .-- .... . .-. . / -. --- / -- .- -. / .... .- ... / --. --- -. . / -... . ..-. --- .-. .");
		
		assertTrue(convert1.equals(test1));
		
		//		String test2 = "they're coming to take me away ha ha?";
		//		String convert2 = mcc
		//				.convertToEnglish("- .... . -.-- .----. .-. . / -.-. --- -- .. -. --. / - --- / - .- -.- . / -- . / .- .-- .- -.-- / .... .- / .... .- ..--..");
		//		
		//		assertTrue(convert2.equals(test2));
		
	}
	
}
